<?php
/**
 */
// from 0 local 1 from_mblog

define("CACHE_PREFIX_PUBU","_pubu_content");

class db_taobao_goods_item extends db_base {
    
	var $table_name = "taobao_goods_item";
	
	function db_taobao_goods_item()
	{
		parent::db_base();
	}
	

	function get_taobao_list_by_site_id($p,$pcount)
	{
		return false;
		global $config;
		$site_id = $config["current_site_id"];
		
		
		$mc = mem_cache::get_instance();
		$id = intval($id);
		$key = CACHE_PREFIX_PUBU."-get_index_tuijian_mblog-{$site_id}";
		$cache = $mc->get($key);
		if ($cache === false)
		{	
			
			if($site_id)
			{
				$where = "site_id = {$site_id} and status = 1";
			}
			else
			{
				$where = "status = 1";
			}
			
			$content = $this->get_alllist($this->table_name,$p,$pcount,"volume desc",$where);
			// 保存MC
			$mc->set($key, serialize($content), 0, CACHE_EXPIRE_HOUR);
		}
		else
		{
			$content = unserialize($cache);
		}
		
		return $content;
	
	}
	
	
	
	function get_list_by_type($p=1,$pcount=16)
	{
		
		$where = "status = 1";
		$res = $this->get_alllist($this->table_name,$p,$pcount,"id desc",$where);
		
		
		return $res;
		
	}

	
	
	function cron_insert_goods($ary,$site_id)
	{
		$ary["create_time"] = Date::get_date_time();
		$ary["status"] = 1;
		$ary["site_id"] = $site_id;
		
		$this->insert($this->table_name,$ary);
	
	}
	
	
	
}



